/*
 * @Author: worldzb 
 * @Date: 2018-06-07 11:15:44 
 * @Last Modified by: worldzb
 * @Last Modified time: 2018-11-10 17:49:15
 */


/**
 * 折叠列表
 */
function foldList() {
	
	$('.foldList-header').off('click').on('click', function () {
		if ($(this).next().css('display') == 'block') {
			$(this).next().css('display', 'none');
			$(this).css({
				background: '#fff',
				color: '#333'
			});
			$(this).children('.foldList-angle').html('+');
		} else {
			$(this).next().css('display', 'block');
			$(this).css({
				background: '#59BBC4',
				color: '#fff'
			});
			$(this).children('.foldList-angle').html('-');
		}
	});
}

/**
 * 数据转换
 */
var Converter=function Converter(){
	this.str2arr=function(str){
		var arrAccount=str.split(';');
		var list=[];
		arrAccount=arrAccount.map(function($v,$k){
			$v=$v.replace(/[\r\n]/g, "");
			if($v!='' && $v!='undefined'){
				list.push($v.split('----'));
			}
		});
		return list;
	}
	this.str2arr_url=function(str){
		var arrAccount=str.split(';');
		var list=[];
		arrAccount=arrAccount.map(function($v,$k){
			$v=$v.replace(/[\r\n]/g, "");
			if($v!='' && $v!='undefined'){
				list.push($v);
			}
		});
		return list;
	}
}

/**
 * 获取当前时间  yyyy-MM-dd HH:MM:SS
 */
function getNowFormatDate() {
    var date = new Date();
    var seperator1 = "-";
    var seperator2 = ":";
    var month = date.getMonth() + 1;
    var strDate = date.getDate();
    if (month >= 1 && month <= 9) {
        month = "0" + month;
    }
    if (strDate >= 0 && strDate <= 9) {
        strDate = "0" + strDate;
    }
    var currentdate = date.getFullYear() + seperator1 + month + seperator1 + strDate
            + " " + date.getHours() + seperator2 + date.getMinutes()
            + seperator2 + date.getSeconds();
    return currentdate;
}

/**
 * 获取当前时间  HH:MM:SS
 */
function getNowTime() {
    var date = new Date();
    var seperator2 = ":";
    var strDate = date.getDate();

    if (strDate >= 0 && strDate <= 9) {
        strDate = "0" + strDate;
    }
    var currentdate =date.getHours() + seperator2 + date.getMinutes()
            + seperator2 + date.getSeconds();
    return currentdate;
}
